<?php


namespace App\Http\Controllers\Admin;


use App\DTOS\Admin\MemberKeepDTO;
use App\Http\Controllers\Controller;
use App\Services\Game\MemberKeepService;
use App\Utils\ResponseUtil;

class MemberKeepController extends Controller
{
    private MemberKeepService $MemberKeepService;

    /**
     * MemberKeepController constructor.
     * @param MemberKeepService $MemberKeepService
     */
    public function __construct(MemberKeepService $MemberKeepService)
    {
        $this->MemberKeepService = $MemberKeepService;
    }

    public function paginate()
    {
        $paginate = $this->MemberKeepService->paginate(new MemberKeepDTO(request()->all()));
        $data = $paginate->items();

        $res = [];
        $res['code'] = 0;
        $res['count'] = $paginate->total();
        $res['data'] = $data;
        return ResponseUtil::json($res);
    }


    public function paypaginate()
    {
        $paginate = $this->MemberKeepService->paypaginate(new MemberKeepDTO(request()->all()));
        $data = $paginate->items();

        $res = [];
        $res['code'] = 0;
        $res['count'] = $paginate->total();
        $res['data'] = $data;
        return ResponseUtil::json($res);
    }

}
